package com.bj.zspace.boot.client.service;

import com.bjzspace.proto.HelloProto;
import com.bjzspace.proto.HelloServiceGrpc;
import net.devh.boot.grpc.client.inject.GrpcClient;
import org.springframework.stereotype.Service;

@Service
public class HelloServiceImpl {


    @GrpcClient("grpc-server")
    private HelloServiceGrpc.HelloServiceBlockingStub helloServiceBlockingStub;

    public String hello(){
        HelloProto.HelloResponse response =
            helloServiceBlockingStub.hello(HelloProto.HelloRequest.newBuilder().setName("boot request").build());
        return response.getResult();
    }

}
